<!-- 用户列表 -->
<template>
  <div class="page-box h100 display-flex czbj">
    <p class="title-label">用户列表</p>
    <div class="mt10">
      <dxtable czWidth="240" :dataJson="dataJson" :portUrl="portUrl" :formJson="formJson" :isshowXz="false" :qx="qx"
        :czFun="czFun" ref="databale">
      </dxtable>
    </div>
    <n-modal v-model:show="showModal" preset="card" style="width: 412px;">
    <template #header>
    <div>优惠券</div>
    </template>
    <div>
      <iframe :src='"https://duxinggj.com/yuyue/#/discountCoupon?openid="+openid' class="kxcxzerxer"></iframe>
    </div>
    <template #action>
    <div class="tr">
    <n-button> 取消 </n-button>
    </div>
    </template>
    </n-modal>
  </div>
</template>
<script lang='ts' setup>
import dxtable from "./../../components/util/dxtable.vue";
import { dxget, dxpost, qurl, hf } from "./../../util/index";
import { h, ref, reactive } from "vue";
import { NButton } from "naive-ui"
const showModal = ref(false)
const openid = ref()
const initeer = () => {
  databale.value.initDataExpose();
};
const databale = ref();
// 弹窗公用该列表
let dataJson = reactive([

  {
    title: '头像',
    key: 'headimgurl',
    render(row) {
      return h('img', { class: "dsfsdtrtr", src: row.headimgurl })
    }
  },
  {
    title: "昵称",
    key: "nickname",
    search: true, // 是否在搜索栏展示
  },

  {
    title: "openid",
    key: "openid",
  },

  {
    title: "登录ip",
    key: "ip",
  },
  {
    title: "所在城市",
    key: "city",
  },
  {
    title: "余额",
    key: "balance",
  }, {
    title: "真实姓名",
    key: "Name",
  }, {
    title: "身份证号码",
    key: "IdCard",
  },




]);
const Userid = localStorage.id
let portUrl = "yuyue/wxcharUser";
const qx = {
  DeletePermissionID: "yybureauFormationdel", //删除
  EditPermissionIdentifier: "yybureauFormationbj", // 编辑
  NewPermissionIdentifier: "yybureauFormationxz", // 新建
  ViewPermissionID: "yybureauFormationck", // 查看
};
let formJson = reactive([

  {
    title: "余额",
    key: "balance",
    type: "input",
    required: true,
  }
])

const czFun = {
  fun: (row, loading) => {
    return [
      h(
        NButton,
        {
          type: "info",
          quaternary: true,
          onClick: async (e) => {
            showModal.value = true
            openid.value = row.openid
          },
        },
        "发放优惠券"
      )

    ];
  },
};
</script>
<style scoped>
  .kxcxzerxer{
    border: 0;
    width: 100%;
    height: 600px;
  }
</style>


